package com.yanqu.road.entity.disperseGold;

import com.alibaba.fastjson.JSON;
import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.player.UserBaseInfo;

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

public class DisperseGoldInfo extends DataObject {
    private long disperseId;
    private long userId;
    private long beginTime;
    private String reward;
    private String manifesto;
    private boolean sendEmail;
    private int playerNum;
    private String honoraryTitles;
    private long serverId;
    private BigInteger earnSpeed;
    private boolean wait = false;
    private UserBaseInfo userBaseInfo = new UserBaseInfo();
    private int channelId;
    private String assistantSkin = "";
    private String badge = "";
    private String privilege = "";

    /**
     * 接收的用户名单（新版商会分组送财）
     * 不入库
     */
    private List<DisperseGoldGroupUser> receiveUserList = new ArrayList<>();

    public boolean isWait() {
        return wait;
    }

    public void setWait(boolean wait) {
        this.wait = wait;
    }

    public long getDisperseId() {
        return disperseId;
    }

    public void setDisperseId(long disperseId) {
        if(this.disperseId != disperseId) {
            this.disperseId = disperseId;
            setUpdateOption();
        }
    }

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        if(this.userId != userId) {
            this.userId = userId;
            setUpdateOption();
        }
    }

    public long getBeginTime() {
        return beginTime;
    }

    public void setBeginTime(long beginTime) {
        if(this.beginTime != beginTime) {
            this.beginTime = beginTime;
            setUpdateOption();
        }
    }

    public String getReward() {
        return reward;
    }

    public void setReward(String reward) {
        if(!Objects.equals(this.reward, reward)) {
            this.reward = reward;
            setUpdateOption();
        }
    }

    public boolean isSendEmail() {
        return sendEmail;
    }

    public void setSendEmail(boolean sendEmail) {
        if(this.sendEmail != sendEmail) {
            this.sendEmail = sendEmail;
            setUpdateOption();
        }
    }

    public String getManifesto() {
        return manifesto;
    }

    public void setManifesto(String manifesto) {
        if(!Objects.equals(this.manifesto, manifesto)) {
            this.manifesto = manifesto;
            setUpdateOption();
        }
    }

    public int getPlayerNum() {
        return playerNum;
    }

    public void setPlayerNum(int playerNum) {
        if(this.playerNum != playerNum) {
            this.playerNum = playerNum;
            setUpdateOption();
        }
    }

    public String getHonoraryTitles() {
        return honoraryTitles;
    }

    public void setHonoraryTitles(String honoraryTitles) {
        if(!Objects.equals(this.honoraryTitles, honoraryTitles)) {
            this.honoraryTitles = honoraryTitles;
            setUpdateOption();
        }
    }

    public long getServerId() {
        return serverId;
    }

    public void setServerId(long serverId) {
        if(this.serverId != serverId) {
            this.serverId = serverId;
            setUpdateOption();
        }
    }

    public BigInteger getEarnSpeed() {
        return earnSpeed;
    }

    public void setEarnSpeed(BigInteger earnSpeed) {
        if(!Objects.equals(this.earnSpeed, earnSpeed)) {
            this.earnSpeed = earnSpeed;
            setUpdateOption();
        }
    }

    public UserBaseInfo getUserBaseInfo() {
        return userBaseInfo;
    }

    public void setUserBaseInfo(UserBaseInfo userBaseInfo) {
        this.userBaseInfo = userBaseInfo;
        setUpdateOption();
    }

    public String getUserBaseInfoJsonString(){
        if(null == userBaseInfo){
            return "{}";
        }else {
            return JSON.toJSONString(userBaseInfo);
        }
    }

    public int getChannelId() {
        return channelId;
    }

    public void setChannelId(int channelId) {
        if (this.channelId != channelId) {
            this.channelId = channelId;
            setUpdateOption();
        }
    }

    public String getAssistantSkin() {
        return assistantSkin;
    }

    public void setAssistantSkin(String assistantSkin) {
        if (assistantSkin == null) {
            return;
        }
        if (!Objects.equals(this.assistantSkin, assistantSkin)) {
            this.assistantSkin = assistantSkin;
            setUpdateOption();
        }
    }

    public String getBadge() {
        return badge;
    }

    public void setBadge(String badge) {
        if (badge == null) {
            return;
        }
        if (!Objects.equals(this.badge, badge)) {
            this.badge = badge;
            setUpdateOption();
        }
    }

    public List<DisperseGoldGroupUser> getReceiveUserList() {
        return receiveUserList;
    }

    public void setReceiveUserList(List<DisperseGoldGroupUser> receiveUserList) {
        this.receiveUserList = receiveUserList;
    }

    public String getPrivilege() {
        return privilege;
    }

    public void setPrivilege(String privilege) {
        if(this.privilege != privilege) {
            this.privilege = privilege;
            setUpdateOption();
        }
    }
}
